'use strict';

const Controller = require('egg').Controller;
const {ObjectId} = require("mongodb")
class DetailController extends Controller {
  async index() {
    var {ctx} = this;
    // console.log(ctx.query);
    console.log(ctx.params);
    var {_id} = ctx.params;
    var db = this.app.mongodb;
    const collection = await db.collection("list215");
    var desc = await collection.find({_id:ObjectId(_id)}).toArray();
    console.log(desc);
    ctx.body = desc
  }
}

module.exports = DetailController;
